Skip to main content

Create Access Token

This API creates a new access token within the tenant. An access token is used for programmatic access to the API and can be scoped to a group, restricted by IP, and configured with an expiration.

Endpoint Details

URL/v1/auth/access-tokens
MethodPOST
AuthorizationBearer Token

Request Headers

HeaderTypeDescription
Content-TypeStringMust be application/json

Request Body

Use the following format to make a request:

JSON Request
{
"name": "dummy",
"description": "",
"group_id": "81ad4d05-d11a-4809-b1f2-cc000c086730",
"ip_restriction": false,
"allowed_ips": [
""
],
"expiration": true,
"expired_at": 1784246400,
"assigned_user_ids": [
"0a937c60-0ed4-4d06-870a-2e284b54287d"
]
}

Parameters

ParameterTypeDescription
nameStringName of the access token
descriptionStringOptional description of the access token
group_idUUIDIdentifier of the group associated with the access token
ip_restrictionBooleanIndicates whether the access token is restricted to specific IPs
allowed_ipsArrayList of allowed IP addresses when ip_restriction is enabled
expirationBooleanIndicates whether the access token has an expiration
expired_atIntegerExpiration timestamp in Unix format when expiration is enabled
assigned_user_idsArrayList of user IDs assigned to the access token

Response

Here is an example response after the request has been successfully processed:

Response
{
"access_token": {
"id": "cc4a3b9a-bb48-49cf-8ee4-a07f88c3ff6d",
"tenant_id": "5ebde17c-01a1-4394-977b-9e611250cf5d",
"name": "Dummy",
"group_id": "81ad4d05-d11a-4809-b1f2-cc000c086730",
"allowed_ips": [
""
],
"expiration": true,
"expired_at": 1784246400,
"created_by": "0a937c60-0ed4-4d06-870a-2e284b54287d",
"updated_by": "0a937c60-0ed4-4d06-870a-2e284b54287d",
"created_at": 1784189995,
"updated_at": 1784189995,
"assigned_user_ids": [
"0a937c60-0ed4-4d06-870a-2e284b54287d"
]
},
"api_key": "c9500fd32e012a56c5d2c02fdd3b1bf58b61c911981522bd7ac87d97ef4defa5"
}

Field Descriptions

FieldTypeDescription
idUUIDUnique identifier of the access token
tenant_idUUIDIdentifier of the tenant that owns the access token
nameStringName of the access token
group_idUUIDIdentifier of the associated group
allowed_ipsArrayList of allowed IP addresses
expirationBooleanIndicates whether the access token has an expiration
expired_atIntegerExpiration timestamp in Unix format
created_byUUIDIdentifier of the user who created the access token
updated_byUUIDIdentifier of the user who last updated the access token
created_atIntegerCreation timestamp in Unix format
updated_atIntegerLast update timestamp in Unix format
assigned_user_idsArrayList of user IDs assigned to the access token
api_keyStringGenerated API key used to authenticate requests

info
  • A valid Bearer Token is required to access this endpoint.
  • The api_key is returned only once at creation time. Store it securely, as it cannot be retrieved again.
  • When ip_restriction is set to true, the allowed_ips list must contain the IP addresses permitted to use the token.
  • When expiration is set to true, the expired_at value determines when the token expires and must be provided as a Unix timestamp. Convert any calendar date to its Unix timestamp before submitting the request.
  • Unix timestamp fields can be converted to a human-readable date and time format as needed.